"""
 -*- coding: utf-8-*-
 @File: mgt_yaml.py
 @Author: chen
 @time: 2023/10/04/ 17:43
"""
import os

import yaml


class MgtYaml:
    cur_path = os.path.dirname(os.path.abspath(__file__))

    def __init__(self, yaml_file):
        self.file = yaml_file

    def read(self):
        # abs_file = os.path
        with open(self.file, "r", encoding="utf8") as file_obj:
            data = yaml.safe_load(file_obj)
            return data

    def get_cap(self, app_name):
        return self.read().get(app_name)


if __name__ == '__main__':
    f1 = "../dev/config/app_config.yaml"
    m1 = MgtYaml(f1)
    print(m1.get_cap("wework"))
